package com.enation.app.javashop.api.client;

import com.enation.app.javashop.model.trade.order.dos.OrderDO;
import com.enation.app.javashop.service.statistics.OrderDataManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

/**
 * 订单信息收集manager
 *
 * @author chopper
 * @version v1.0
 * @Description:
 * @since v7.0
 * 2018/5/8 上午8:22
 */
@RestController
@RequestMapping("/client/statistics")
@Validated
@ApiIgnore
public class OrderDataClientController {

    @Autowired
    private OrderDataManager orderDataManager;

    /**
     * 订单新增
     *
     * @param order
     */
    @RequestMapping(value = "/order/put", method = RequestMethod.POST)
    public void put(@RequestBody OrderDO order){
        orderDataManager.put(order);
    }

    /**
     * 订单修改
     *
     * @param order
     */
    @RequestMapping(value = "/order/update", method = RequestMethod.POST)
    public void change(@RequestBody OrderDO order){
        orderDataManager.change(order);
    }

}
